//
//  CDGuide2ViewController.m
//  CollectToDesktop
//
//  Created by 王启颖 on 2020/10/19.
//  Copyright © 2020 godbe. All rights reserved.
//

#import "CDGuide2ViewController.h"

@interface CDGuide2ViewController ()
@property (strong, nonatomic) UIScrollView *scrollView;
@end

@implementation CDGuide2ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    [self scrollView];
    
    UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
    [button setImage:[UIImage imageNamed:@"返 回(2)"] forState:UIControlStateNormal];
    [button setFrame:CGRectMake(0, 0, 60, 40)];
    button.contentEdgeInsets = UIEdgeInsetsMake(0, -20,0, 0);
    [button addTarget:self action:@selector(navigationItemBack) forControlEvents:UIControlEventTouchUpInside];
    UIBarButtonItem *item = [[UIBarButtonItem alloc] initWithCustomView:button];
    self.navigationItem.leftBarButtonItem =  item;
}

-(void)navigationItemBack{
    [self.navigationController popViewControllerAnimated:YES];
}

-(UIScrollView *)scrollView{
    if (!_scrollView) {
        _scrollView = [[UIScrollView alloc]initWithFrame:self.view.bounds];
        [self.view addSubview:_scrollView];
        
        UIImageView *bgImg = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, kDeviceWidth, (kDeviceWidth/752)*3358)];
        bgImg.image = [UIImage imageNamed:@"引导"];
        [_scrollView addSubview:bgImg];
        _scrollView.contentSize = CGSizeMake(0, (kDeviceWidth/752)*3358);
    }
    return _scrollView;
}

@end
